package com.cndw.kungfu.domain;

import com.cndw.asyncsync.SyncObject;
import com.cndw.kungfu.model.Context;
import com.cndw.kungfu.vo.FriendVO;

/**
 * 玩家好友实体类
 * @author fantadust
 * @date 2011-5-13 下午10:42:27
 */
public class Friend extends SyncObject {
	/**
	 * 编号
	 */
	private int id;
	/**
	 * 角色id
	 */
	private long playerId;
	/**
	 * 好友id
	 */
	private long friendId;
	/**
	 * 别名
	 */
	private String friendName;
	/**
	 * 昵称
	 */
	private String nickName;
	/**
	 * 职业id
	 */
	private int vocationId;
	/**
	 * 分组id
	 */
	private int groupId;
	/**
	 * 添加时间
	 */
	private int addTime;
	/**
	 * 上次说话时间
	 */
	private int lastTalk;
	/**
	 * 亲密度
	 */
	private int intimacy;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public long getPlayerId() {
		return playerId;
	}
	public void setPlayerId(long playerId) {
		this.playerId = playerId;
	}
	public long getFriendId() {
		return friendId;
	}
	public void setFriendId(long friendId) {
		this.friendId = friendId;
	}
	public String getFriendName() {
		return friendName;
	}
	public void setFriendName(String friendName) {
		this.friendName = friendName;
	}
	public int getVocationId() {
		return vocationId;
	}
	public void setVocationId(int vocationId) {
		this.vocationId = vocationId;
	}
	public int getGroupId() {
		return groupId;
	}
	public void setGroupId(int groupId) {
		this.groupId = groupId;
	}
	public int getAddTime() {
		return addTime;
	}
	public void setAddTime(int addTime) {
		this.addTime = addTime;
	}
	public int getLastTalk() {
		return lastTalk;
	}
	public void setLastTalk(int lastTalk) {
		this.lastTalk = lastTalk;
	}
	
	public String getNickName() {
		return nickName;
	}
	public void setNickName(String nickName) {
		this.nickName = nickName;
	}
	
	public int getIntimacy() {
		return intimacy;
	}
	public void setIntimacy(int intimacy) {
		this.intimacy = intimacy;
	}
	
	public synchronized void alterIntimacy(int alter){
		intimacy += alter ;
	}
	
	
	public FriendVO toFriendVO(){
		return new FriendVO(this);
	}
	@Override
	public boolean syncDB() {
		return Context.getSyncServer().syncDB(this);
	}
	
	
	
}
